﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ch01
{
    public partial class Form9 : Form
    {
        Form1 f1;
        Form2 f2;

        public Form9()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //打开第一个窗体
            f1 = new Form1();
            f1.Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //打开第二个窗体
            f2 = new Form2();
            f2.Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            //激活第一个窗体
            f1.Activate();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            //激活第二个窗体
            f2.Activate();
        }
    }
}
